package com.geekydoo;

/**
 * The purpose of this class is to create exceptions that can be thrown when an
 * event occurs that prevents the program from running any further. It also
 * provides the opportunity for creating exceptions with more user-friendly
 * error messages.
 * 
 * @author Patrick Dutch
 */
public class GeekyDooException extends Exception {

	private static final long serialVersionUID = 1L;
	private Throwable parentException;

	/**
	 * Constructs a new GeekyDooException with the msg argument as the detail
	 * message and the parent argument as the exception that caused this
	 * GeekyDooException to be thrown.
	 * 
	 * @param msg The detail message
	 */
	public GeekyDooException(String msg, Throwable parent) {
		super(msg);
		parentException = parent;
	}

	/**
	 * This method returns the exception which caused this GeekyDooException to
	 * be thrown.
	 * 
	 * @return The caught exception which resulted in this exception being
	 *         thrown
	 */
	public Throwable getParentException() {
		return parentException;
	}

}
